<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt"  prefix="fmt"%>
<p>
	<html:link href="#" onclick="sendRequest('newsAction.do', 'GET', 'method=list')">
		<bean:message key="label.link.News"/> 
	</html:link> &gt;&gt;
	<bean:message key="label.newslist.title"/> <br/>
</p>
<html:form>
	<c:forEach items="${newsForm.newsList}" var="news">
		<ul>
			<li class="news">
				<p class="date">
					<c:set var="pattern">
						<bean:message key="format.date" />
					</c:set>
					<fmt:formatDate value="${news.date}" pattern="${pattern}"/> 
				</p>
				<p class="title">
					 ${news.title}
				</p>
				<p class="brief">
					${news.brief}
				</p>
				<input class="checkBox" type="checkbox" name="selectedNews" value="${news.id}"/>
				<p class="edit">
					<html:link href="#" onclick="sendRequest('newsAction.do', 'GET', 'method=edit&currentNewsId=${news.id}')">
						<bean:message key="label.newslist.link.edit" />
					</html:link>
				</p>
				<p class="view"> 
					<html:link href="#" onclick="sendRequest('newsAction.do', 'GET', 'method=view&currentNewsId=${news.id}')">
						<bean:message key="label.newslist.link.view" />
					</html:link>
				</p>								
			</li>
		</ul>
	</c:forEach>
	<c:if test="${not empty newsForm.newsList }">
		<input id="deleteButton" type="button" value="<bean:message key="label.newslist.button.delete" />" onclick="deleteFromList()" />
	</c:if>
</html:form>